import Vue from "vue";
import MyConfirm from "./MyConfirm.vue"

// console.log(MyConfirm)
const ConfirmConstructor = Vue.extend(MyConfirm)

const confirmInstance = new ConfirmConstructor()


const div = document.createElement('div')
document.body.appendChild(div)


confirmInstance.$mount(div)

// 1. 该函数只要调用  就让确认框显示出来  
export default function(text) {
    confirmInstance.visible = true;
    confirmInstance.setText(text);

    return new Promise((resolve, reject) => {
        confirmInstance.executor(resolve, reject)
    })
}